

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class NorthPanel extends JPanel {
	JButton listenBtn = new JButton("listen");

	JButton linkBtn = new JButton("link");

	JTextField ipTF = new JTextField(50);

	public NorthPanel() {
		setLayout(new FlowLayout());
		add(listenBtn);
		add(ipTF);
		add(linkBtn);
		listenBtn.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent arg0) {
				Constants.net.startListen();
			}
		});
		linkBtn.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent arg0) {
				String ip = ipTF.getText();
				Constants.net.startLink(ip);
			}
		});
	}
}
